Skip to content
This repository was archived by the owner on May 26, 2026. It is now read-only.

[DmfsTask] implement time field handlers#437

Merged
sunkup merged 4 commits into
mainfrom
430-dmfstask-implement-time-field-handlers
May 26, 2026
Merged

[DmfsTask] implement time field handlers#437
sunkup merged 4 commits into
mainfrom
430-dmfstask-implement-time-field-handlers

Conversation

@sunkup

@sunkup sunkup commented May 22, 2026

Copy link
Copy Markdown
Member

No description provided.

@sunkup sunkup linked an issue May 22, 2026 that may be closed by this pull request
@sunkup sunkup added refactoring Quality improvement of existing functions tasks Regarding tasks / everything that's stored in a task app provider labels May 22, 2026
@sunkup sunkup self-assigned this May 22, 2026
@sunkup sunkup force-pushed the 430-dmfstask-implement-time-field-handlers branch from b99d8a1 to e25d272 Compare May 22, 2026 12:57
@sunkup sunkup requested a review from Copilot May 22, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors dmfs task time-related field mapping by extracting timestamp → iCalendar temporal conversion into a dedicated utility and introducing dedicated field handlers, with Robolectric tests validating expected conversions.

Changes:

  • Added TaskTimeField to convert dmfs task timestamps (+ TZ/all-day) into the appropriate Temporal for iCalendar properties.
  • Introduced StartTimeHandler, DueHandler, and DurationHandler and wired them into DmfsTaskProcessor.
  • Added Robolectric unit tests for DTSTART, DUE, and DURATION handling.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/DmfsTaskProcessor.kt Replaces inline DTSTART/DUE/DURATION mapping with new field handlers.
lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/TaskTimeField.kt New utility for converting dmfs task timestamps into LocalDate/Instant/ZonedDateTime.
lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/StartTimeHandler.kt New handler that maps Tasks.DTSTART into Task.dtStart.
lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/DueHandler.kt New handler that maps Tasks.DUE into Task.due.
lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/DurationHandler.kt New handler that maps Tasks.DURATION into Task.duration.
lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/handler/StartTimeHandlerTest.kt Tests DTSTART mapping for all-day, TZ-based, and UTC-instant cases.
lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/handler/DueHandlerTest.kt Tests DUE mapping for all-day, TZ-based, and UTC-instant cases.
lib/src/test/kotlin/at/bitfire/synctools/mapping/tasks/handler/DurationHandlerTest.kt Tests DURATION parsing/mapping for representative values.

Comment thread lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/TaskTimeField.kt Outdated
Comment thread lib/src/main/kotlin/at/bitfire/synctools/mapping/tasks/handler/TaskTimeField.kt Outdated
@sunkup sunkup force-pushed the 430-dmfstask-implement-time-field-handlers branch from e25d272 to 4b3cfd9 Compare May 22, 2026 13:20
@sunkup sunkup requested a review from rfc2822 May 22, 2026 13:28
@sunkup sunkup marked this pull request as ready for review May 22, 2026 13:28
@sunkup sunkup merged commit 19ffc2f into main May 26, 2026
9 checks passed
@sunkup sunkup deleted the 430-dmfstask-implement-time-field-handlers branch May 26, 2026 09:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

refactoring Quality improvement of existing functions tasks Regarding tasks / everything that's stored in a task app provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DmfsTask: implement time field handlers

3 participants